﻿namespace ArtemisExtensions
{
    /// <summary>
    /// Contains all the Entities. Only one Universe
    /// </summary>
    public sealed class Universe : IContainingLocation
    {
        /// <summary>
        /// Stores the only universe
        /// </summary>
        private static Universe instance;

        /// <summary>
        /// Constructor
        /// </summary>
        private Universe()
        {
        }

        /// <summary>
        /// Returns the universe
        /// </summary>
        public static Universe Instance
        {
            get
            {
                if (instance == null)
                {
                    instance = new Universe();
                }
                return instance;
            }
        }

        public ComponentManager ComponentManager
        {
            get;
            private set;
        }

        public GenericTime CurrentTime
        {
            get;
            private set;
        }

        public EntitySystemManager EntitySystemManager
        {
            get;
            private set;
        }

        [System.Obsolete()]
        public System.Collections.Generic.List<ArtemisExtensions.ILocation> TopLevelLocations
        {
            get;
            private set;
        }

        public MapTileManager MapTileManager
        {
            get
            {
                throw new System.NotImplementedException();
            }
            set
            {
            }
        }

        public OverlandMap OverlandMap
        {
            get
            {
                throw new System.NotImplementedException();
            }
            set
            {
            }
        }

        public void Update()
        {
            EntitySystemManager.Update();
            CurrentTime.Increment();
        }
    }
}